package com.he.micro_search;

import com.he.service.ISearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class RunningApplication implements CommandLineRunner {

    @Autowired
    private ISearchService searchService;

    @Override
    public void run(String... args) throws Exception {
        //SpringBoot项目运行时触发
        System.out.println("搜索服务已经启动，尝试构建索引库....");

        searchService.createIndex();
    }
}
